package com.fc.v2.model.auto;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import cn.hutool.core.util.StrUtil;

/**
 * 会员管理表 ViplistExample
 * @author fuce_自动生成
 * @date 2021-04-20 10:38:15
 */
public class ViplistExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public ViplistExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }
        
				
        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLike(Integer value) {
            addCriterion("id like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotLike(Integer value) {
            addCriterion("id not like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }
        
				
        public Criteria andVipNameIsNull() {
            addCriterion("vip_name is null");
            return (Criteria) this;
        }

        public Criteria andVipNameIsNotNull() {
            addCriterion("vip_name is not null");
            return (Criteria) this;
        }

        public Criteria andVipNameEqualTo(String value) {
            addCriterion("vip_name =", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameNotEqualTo(String value) {
            addCriterion("vip_name <>", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameGreaterThan(String value) {
            addCriterion("vip_name >", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameGreaterThanOrEqualTo(String value) {
            addCriterion("vip_name >=", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameLessThan(String value) {
            addCriterion("vip_name <", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameLessThanOrEqualTo(String value) {
            addCriterion("vip_name <=", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameLike(String value) {
            addCriterion("vip_name like", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameNotLike(String value) {
            addCriterion("vip_name not like", value, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameIn(List<String> values) {
            addCriterion("vip_name in", values, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameNotIn(List<String> values) {
            addCriterion("vip_name not in", values, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameBetween(String value1, String value2) {
            addCriterion("vip_name between", value1, value2, "vipName");
            return (Criteria) this;
        }

        public Criteria andVipNameNotBetween(String value1, String value2) {
            addCriterion("vip_name not between", value1, value2, "vipName");
            return (Criteria) this;
        }
        
				
        public Criteria andVipSexIsNull() {
            addCriterion("vip_sex is null");
            return (Criteria) this;
        }

        public Criteria andVipSexIsNotNull() {
            addCriterion("vip_sex is not null");
            return (Criteria) this;
        }

        public Criteria andVipSexEqualTo(String value) {
            addCriterion("vip_sex =", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexNotEqualTo(String value) {
            addCriterion("vip_sex <>", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexGreaterThan(String value) {
            addCriterion("vip_sex >", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexGreaterThanOrEqualTo(String value) {
            addCriterion("vip_sex >=", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexLessThan(String value) {
            addCriterion("vip_sex <", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexLessThanOrEqualTo(String value) {
            addCriterion("vip_sex <=", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexLike(String value) {
            addCriterion("vip_sex like", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexNotLike(String value) {
            addCriterion("vip_sex not like", value, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexIn(List<String> values) {
            addCriterion("vip_sex in", values, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexNotIn(List<String> values) {
            addCriterion("vip_sex not in", values, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexBetween(String value1, String value2) {
            addCriterion("vip_sex between", value1, value2, "vipSex");
            return (Criteria) this;
        }

        public Criteria andVipSexNotBetween(String value1, String value2) {
            addCriterion("vip_sex not between", value1, value2, "vipSex");
            return (Criteria) this;
        }
        
				
        public Criteria andVipTelIsNull() {
            addCriterion("vip_tel is null");
            return (Criteria) this;
        }

        public Criteria andVipTelIsNotNull() {
            addCriterion("vip_tel is not null");
            return (Criteria) this;
        }

        public Criteria andVipTelEqualTo(Integer value) {
            addCriterion("vip_tel =", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelNotEqualTo(Integer value) {
            addCriterion("vip_tel <>", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelGreaterThan(Integer value) {
            addCriterion("vip_tel >", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelGreaterThanOrEqualTo(Integer value) {
            addCriterion("vip_tel >=", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelLessThan(Integer value) {
            addCriterion("vip_tel <", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelLessThanOrEqualTo(Integer value) {
            addCriterion("vip_tel <=", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelLike(Integer value) {
            addCriterion("vip_tel like", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelNotLike(Integer value) {
            addCriterion("vip_tel not like", value, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelIn(List<Integer> values) {
            addCriterion("vip_tel in", values, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelNotIn(List<Integer> values) {
            addCriterion("vip_tel not in", values, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelBetween(Integer value1, Integer value2) {
            addCriterion("vip_tel between", value1, value2, "vipTel");
            return (Criteria) this;
        }

        public Criteria andVipTelNotBetween(Integer value1, Integer value2) {
            addCriterion("vip_tel not between", value1, value2, "vipTel");
            return (Criteria) this;
        }
        
				
        public Criteria andValueCardIdIsNull() {
            addCriterion("valueCard_id is null");
            return (Criteria) this;
        }

        public Criteria andValueCardIdIsNotNull() {
            addCriterion("valueCard_id is not null");
            return (Criteria) this;
        }

        public Criteria andValueCardIdEqualTo(Integer value) {
            addCriterion("valueCard_id =", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdNotEqualTo(Integer value) {
            addCriterion("valueCard_id <>", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdGreaterThan(Integer value) {
            addCriterion("valueCard_id >", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("valueCard_id >=", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdLessThan(Integer value) {
            addCriterion("valueCard_id <", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdLessThanOrEqualTo(Integer value) {
            addCriterion("valueCard_id <=", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdLike(Integer value) {
            addCriterion("valueCard_id like", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdNotLike(Integer value) {
            addCriterion("valueCard_id not like", value, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdIn(List<Integer> values) {
            addCriterion("valueCard_id in", values, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdNotIn(List<Integer> values) {
            addCriterion("valueCard_id not in", values, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdBetween(Integer value1, Integer value2) {
            addCriterion("valueCard_id between", value1, value2, "valueCardId");
            return (Criteria) this;
        }

        public Criteria andValueCardIdNotBetween(Integer value1, Integer value2) {
            addCriterion("valueCard_id not between", value1, value2, "valueCardId");
            return (Criteria) this;
        }
        
				
        public Criteria andValueCardBalanceIsNull() {
            addCriterion("valueCard_balance is null");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceIsNotNull() {
            addCriterion("valueCard_balance is not null");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceEqualTo(Integer value) {
            addCriterion("valueCard_balance =", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceNotEqualTo(Integer value) {
            addCriterion("valueCard_balance <>", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceGreaterThan(Integer value) {
            addCriterion("valueCard_balance >", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceGreaterThanOrEqualTo(Integer value) {
            addCriterion("valueCard_balance >=", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceLessThan(Integer value) {
            addCriterion("valueCard_balance <", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceLessThanOrEqualTo(Integer value) {
            addCriterion("valueCard_balance <=", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceLike(Integer value) {
            addCriterion("valueCard_balance like", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceNotLike(Integer value) {
            addCriterion("valueCard_balance not like", value, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceIn(List<Integer> values) {
            addCriterion("valueCard_balance in", values, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceNotIn(List<Integer> values) {
            addCriterion("valueCard_balance not in", values, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceBetween(Integer value1, Integer value2) {
            addCriterion("valueCard_balance between", value1, value2, "valueCardBalance");
            return (Criteria) this;
        }

        public Criteria andValueCardBalanceNotBetween(Integer value1, Integer value2) {
            addCriterion("valueCard_balance not between", value1, value2, "valueCardBalance");
            return (Criteria) this;
        }
        
			
		 public Criteria andLikeQuery(Viplist record) {
		 	List<String> list= new ArrayList<String>();
		 	List<String> list2= new ArrayList<String>();
        	StringBuffer buffer=new StringBuffer();
			if(record.getId()!=null&&StrUtil.isNotEmpty(record.getId().toString())) {
    			 list.add("ifnull(id,'')");
    		}
			if(record.getVipName()!=null&&StrUtil.isNotEmpty(record.getVipName().toString())) {
    			 list.add("ifnull(vip_name,'')");
    		}
			if(record.getVipSex()!=null&&StrUtil.isNotEmpty(record.getVipSex().toString())) {
    			 list.add("ifnull(vip_sex,'')");
    		}
			if(record.getVipTel()!=null&&StrUtil.isNotEmpty(record.getVipTel().toString())) {
    			 list.add("ifnull(vip_tel,'')");
    		}
			if(record.getValueCardId()!=null&&StrUtil.isNotEmpty(record.getValueCardId().toString())) {
    			 list.add("ifnull(valueCard_id,'')");
    		}
			if(record.getValueCardBalance()!=null&&StrUtil.isNotEmpty(record.getValueCardBalance().toString())) {
    			 list.add("ifnull(valueCard_balance,'')");
    		}
			if(record.getId()!=null&&StrUtil.isNotEmpty(record.getId().toString())) {
    			list2.add("'%"+record.getId()+"%'");
    		}
			if(record.getVipName()!=null&&StrUtil.isNotEmpty(record.getVipName().toString())) {
    			list2.add("'%"+record.getVipName()+"%'");
    		}
			if(record.getVipSex()!=null&&StrUtil.isNotEmpty(record.getVipSex().toString())) {
    			list2.add("'%"+record.getVipSex()+"%'");
    		}
			if(record.getVipTel()!=null&&StrUtil.isNotEmpty(record.getVipTel().toString())) {
    			list2.add("'%"+record.getVipTel()+"%'");
    		}
			if(record.getValueCardId()!=null&&StrUtil.isNotEmpty(record.getValueCardId().toString())) {
    			list2.add("'%"+record.getValueCardId()+"%'");
    		}
			if(record.getValueCardBalance()!=null&&StrUtil.isNotEmpty(record.getValueCardBalance().toString())) {
    			list2.add("'%"+record.getValueCardBalance()+"%'");
    		}
        	buffer.append(" CONCAT(");
	        buffer.append(StrUtil.join(",",list));
        	buffer.append(")");
        	buffer.append(" like CONCAT(");
        	buffer.append(StrUtil.join(",",list2));
        	buffer.append(")");
        	if(!" CONCAT() like CONCAT()".equals(buffer.toString())) {
        		addCriterion(buffer.toString());
        	}
        	return (Criteria) this;
        }
        
        public Criteria andLikeQuery2(String searchText) {
		 	List<String> list= new ArrayList<String>();
        	StringBuffer buffer=new StringBuffer();
    		list.add("ifnull(id,'')");
    		list.add("ifnull(vip_name,'')");
    		list.add("ifnull(vip_sex,'')");
    		list.add("ifnull(vip_tel,'')");
    		list.add("ifnull(valueCard_id,'')");
    		list.add("ifnull(valueCard_balance,'')");
        	buffer.append(" CONCAT(");
	        buffer.append(StrUtil.join(",",list));
        	buffer.append(")");
        	buffer.append("like '%");
        	buffer.append(searchText);
        	buffer.append("%'");
        	addCriterion(buffer.toString());
        	return (Criteria) this;
        }
        
}
	
    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}